package com.yvtian.inv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yvtian.inv.pojo.InvSuMaterialRequestItemEntity;
import com.yvtian.inv.dao.InvSuMaterialRequestItemMapper;
import com.yvtian.inv.service.InvSuMaterialRequestItemService;
import com.yvtian.utils.StringHelper;
import org.springframework.stereotype.Service;

/**
 * 生产补领料单明细(inv_su_material_request_item)表服务实现类
 *
 * @author long
 * @since 2024-07-02 13:43:43
 */
@Service("invSuMaterialRequestItemService")
public class InvSuMaterialRequestItemServiceImpl extends ServiceImpl<InvSuMaterialRequestItemMapper, InvSuMaterialRequestItemEntity> implements InvSuMaterialRequestItemService {

    @Override
    public IPage<InvSuMaterialRequestItemEntity> findByPage(Page<InvSuMaterialRequestItemEntity> page, InvSuMaterialRequestItemEntity invSuMaterialRequestItemEntity) {
        LambdaQueryWrapper<InvSuMaterialRequestItemEntity> queryWrapper = new LambdaQueryWrapper<>();
        if (StringHelper.isNotEmpty(invSuMaterialRequestItemEntity.getZcode())) {
            queryWrapper.eq(InvSuMaterialRequestItemEntity::getZcode, invSuMaterialRequestItemEntity.getZcode());
        }
        return this.page(page, queryWrapper);
    }
}

